package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.Ticket;
import cn.wolfcode.luowowo.article.mapper.TicketMapper;
import cn.wolfcode.luowowo.article.service.ITicketService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class TicketServiceImpl implements ITicketService {

    @Autowired
    private TicketMapper ticketMapper;

    public List<Ticket> listByDestId(Long ajaxDestId) {
        List<Ticket> tickets = ticketMapper.listByDestId(ajaxDestId);
        return tickets;
    }

    public List<Ticket> listByDestIdAndTagId(Long destId, Long tagId) {
        return ticketMapper.listByDestIdAndTagId(destId,tagId);
    }

    public List<Ticket> listTop4(Long destId) {
        return ticketMapper.listTop4(destId);
    }

    public Ticket getById(Long tid) {
        return ticketMapper.selectByPrimaryKey(tid);
    }
}
